package problems;

import lib.MathLib;

public class Euler036 extends AbstractEuler {

	@Override
	public Number calculate() {
		int answer = 0;
		
		for (int i = 1; i < 1000000; i++) {
			if (MathLib.isPalindromeInBase10(i) && MathLib.isPalindromeInBase2(i)) answer += i;
		}
		
		return answer;
	}

	@Override
	protected Number getCorrectAnswer() {
		return 872187;
	}

}
